#ifndef __FG__I__MODULE__H__
#define __FG__I__MODULE__H__
#include <string>
#include "IPluginManager.h"

namespace FragrantGrass
{
	class IModule
	{
	public:
		IModule()
		{
			m_pPluginManager = NULL;
		}

		virtual ~IModule() {}

		virtual bool Awake()
		{
			return true;
		}

		virtual bool Init()
		{
			return true;
		}

		virtual bool AfterInit()
		{
			return true;
		}

		virtual bool CheckConfig()
		{
			return true;
		}

		virtual bool ReadyExecute()
		{
			return true;
		}

		virtual bool Execute()
		{
			return true;
		}

		virtual bool BeforeShut()
		{
			return true;
		}

		virtual bool Shut()
		{
			return true;
		}

		virtual bool Finalize()
		{
			return true;
		}

		virtual bool OnReloadPlugin()
		{
			return true;
		}

		virtual IPluginManager* GetPluginManager() const
		{
			return m_pPluginManager;
		}

		virtual void YieldCo(const int64_t fSecond)
		{
			m_pPluginManager->YieldCo(fSecond);
		}

		virtual void YieldCo()
		{
			m_pPluginManager->YieldCo();
		}

		std::string strName;

	protected:
		IPluginManager* m_pPluginManager;
	};
}
#endif
